'\"macro stdmacro
.\"
.\" Copyright (c) 2021 Red Hat.
.\" Copyright (c) 2009 Max Matveev
.\" Copyright (c) 2009 Aconex.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH MMV_INC_VALUE 3 "" "Performance Co-Pilot"
.SH NAME
\f3mmv_inc\f1,
\f3mmv_inc_value\f1,
\f3mmv_inc_atomvalue\f1 \- update a value in a Memory Mapped Value file
.SH "C SYNOPSIS"
.ft 3
.ad l
.hy 0
#include <pcp/pmapi.h>
.br
#include <pcp/mmv_stats.h>
.sp
void mmv_inc_value(void *\fIaddr\fP, pmAtomValue *\fIav\fP, double \fIinc\fP);
.br
void mmv_inc_atomvalue(void *\fIaddr\fP,
'in +\w'void mmv_inc_atomvalue('u
pmAtomValue\ *\fIav\fP,
pmAtomValue\ *\fIinc\fP);
.in
.sp
cc ... \-lpcp_mmv \-lpcp
.hy
.ad
.ft 1
.SH DESCRIPTION
\f3mmv_inc_value\f1
and
\f3mmv_inc_atomvalue\f1
provide convenient ways of updating a metric \f2av\f1 previously
returned by the
.BR mmv_lookup_value_desc (3)
interface.
\f2addr\f1 is the address returned from
.BR mmv_stats_init (3).
.P
These interfaces are most commonly used with counter type metrics.
Refer to
.BR mmv_set_value (3)
for a mechanism suited to instantaneous and discrete metrics.
.P
With
\f3mmv_inc_atomvalue\f1 the value provided via the \f2inc\f1
pointer must match the type of the metric, and will be added
to the previous value of the metric.
.P
In the case of
\f3mmv_inc_value\f1
the value of \f2inc\f1 is internally cast to match the type of
the metric and then added to the previous value of the metric.
.SH SEE ALSO
.BR mmv_set_value (3),
.BR mmv_stats_init (3),
.BR mmv_lookup_value_desc (3)
and
.BR mmv (5).

.\" control lines for scripts/man-spell
.\" +ok+
.\" +ok+
